package some.bookmark.dao;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import some.bookmark.domain.BookmarkCommand;


@Component
public class BookmarkDaoImpl extends SqlSessionDaoSupport implements BookmarkDao{

	@Override
	public List<BookmarkCommand> MarkList(String id) {
		List<BookmarkCommand> list = getSqlSession().selectList("BookmarkDao.markList",id);
		return list;
	}

	@Override
	public void insertMark(BookmarkCommand bookmarkCommand) {
		getSqlSession().insert("BookmarkDao.insertMark", bookmarkCommand);
	}

	@Override
	public void deleteMark(BookmarkCommand bookmarkCommand) {
		getSqlSession().delete("BookmarkDao.deleteMark", bookmarkCommand);
		
	}

	@Override
	public int checkMark(BookmarkCommand bookmarkCommand) {
		return getSqlSession().selectOne("BookmarkDao.checkMark", bookmarkCommand);
	}

	@Override
	public int checkMarkCount(String id) {
		return getSqlSession().selectOne("BookmarkDao.checkMarkCount", id);
	}

	@Override
	public List<BookmarkCommand> wishList(String id) {
		List<BookmarkCommand> list = getSqlSession().selectList("BookmarkDao.wishList",id);
		return list;
	}
}
